import { View } from "../../../../mvc/core/View";
import { LayerManager } from "../../../manager/LayerManager";
import { Global } from "../../../../../com/gengine/global/Global";
import { ChatHintIcon } from "./ChatHintIcon";
import { Vector } from "../../../../../__AS3__/vec/Vector";
type int = number;
//class ChatHintIconView
    
    export  class ChatHintIconView extends View
    {
        constructor(arg1: A)
        {
            
            layer = LayerManager.uiLayer;
            this._vcIcon = new Vector.<flash.display.Sprite>();
            this.init();
            this.x = 50;
            this.y = Global.stage.stageHeight - 100;
            this.show();
            this.mouseEnabled = false;
            return;
        }

        /* internal  */init(): void
        {
            this.createView();
            this.addListeners();
            return;
        }

        /* internal  */createView(): void
        {
            return;
        }

        /* internal  */addListeners(): void
        {
            return;
        }

        public hasHincIcon(arg1: Object /* flash.display.Sprite */): Boolean
        {
            return this._vcIcon.indexOf(arg1) >= 0;
        }

        public removeIcon(arg1: Object /* flash.display.Sprite */): void
        {
            if (this._vcIcon.indexOf(arg1) >= 0) 
            {
                this._vcIcon.splice(this._vcIcon.indexOf(arg1), 1);
                this.draw();
            }
            return;
        }

        public addIcon(arg1: Object /* flash.display.Sprite */): void
        {
            if (this._vcIcon.indexOf(arg1) < 0) 
            {
                this._vcIcon.push(arg1);
                this.draw();
            }
            return;
        }

        public /* override */ show(arg1: int=0, arg2: int=0): void
        {
            super.show(arg1, arg2);
            return;
        }

        /* internal  */draw(): void
        {
            var loc2=null;
            this.clear();
            var loc1=0;
            while (loc1 < this._vcIcon.length) 
            {
                loc2 = this._vcIcon[loc1];
                loc2.x = (loc1 - 1) * (ChatHintIcon.iconWidth + this._gap);
                this.addChild(loc2);
                ++loc1;
            }
            return;
        }

        /* internal  */clear(): void
        {
            var loc1=this.numChildren;
            var loc2;
            --loc2;
            while (loc2 >= 0) 
            {
                this.removeChildAt(loc2);
                --loc2;
            }
            return;
        }

        public static instance(): ChatHintIconView
        {
            if (!ChatHintIconView._instance) 
            {
                ChatHintIconView._instance = new ChatHintIconView(new A());
            }
            return ChatHintIconView._instance;
        }

        /* internal */ /* var */_vcIcon: Vector.<flash.display.Sprite>;

        /* internal */ /* var */_gap: int=5;

        /* internal */ static /* var */_instance: ChatHintIconView;
    }
}


class A
{
    public A()
    {
        super();
        return;
    }
